package com.big.user.biz.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.big.common.core.result.Result;
import com.big.common.mybatis.base.controller.BaseController;
import com.big.user.api.domain.dto.SysUserDTO;
import com.big.user.api.feign.RemoteUserFeignClient;
import com.big.user.biz.domain.entity.SysUser;
import com.big.user.biz.service.SysUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * </p>
 *
 * @author 山归岿
 * @create 2025-06-21-19:15
 */
@Tag(name = "系统用户表管理")
@RestController
@RequestMapping("/user")
public class SysUSerController extends BaseController<SysUserDTO, SysUser, SysUserService> implements RemoteUserFeignClient {

    protected SysUSerController(SysUserService service) {
        super(service);
    }

    @PostMapping("checkUserDuplicate")
    public Result<SysUserDTO> checkUserDuplicate(SysUserDTO userDTO) {
        return Result.ok(this.service.getOneDTO(userDTO));
    }

    @Override
    @SaIgnore
    public Result<SysUserDTO> getOneDTO(SysUserDTO userDTO) {
        return Result.ok(this.service.getOneDTO(userDTO));
    }


    @Override
    public Result<String> updateByIdDTO(SysUserDTO userDTO) {
        return Result.ok(this.service.update(userDTO));
    }

}
